Proving program refinements and transformations

نویسنده

  • Martin Ward
چکیده

In this thesis we develop a theory of program refinement and equivalence which can be used to develop practical tools for program development, analysis and modification. The theory is based on the use of general specifications and an imperative kernel language. We use weakest preconditions, expressed as formulae in infinitary logic to prove refinement and equivalence between programs. The kernel language is extended by means of “definitional transformations” which define new concepts in terms of those already present. The extensions include practical programming constructs, including recursive procedures, local variables, functions and expressions with side-effects. This expands the language into a “Wide Spectrum Language” which covers the whole range of operations from general specifications to assignments, jumps and labels. We develop theorems for proving the termination of recursive and iterative programs, transforming specifications into recursive programs and transforming recursive procedures into iterative equivalents. We develop a rigorous framework for reasoning about programs with exit statements that terminate nested loops from within; and this forms the basis for many efficiency-improving and restructuring transformations. These are used as a tool for program analysis and to derive algorithms by transforming their specifications. We show that the methods of top-down design and program verification using assertions can be viewed as the application of a small subset of transformations.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Foundations for a Practical Theory of Program Refinement and Transformation

A wide spectrum language is presented, which is designed to facilitate the proof of the correctness of refinements and transformations. Two different proof methods are introduced and used to prove some fundamental transformations, including a general induction rule (Lemma 3.9) which enables transformations of recursive and iterative programs to be proved by induction on their finite truncations...

متن کامل

A Theorem Proving Approach for Verification of Reactive Concurrent Programs

We present a framework for the specification and verification of reactive concurrent programs using generalpurpose mechanical theorem proving. We define specifications for concurrent programs by formalizing a notion of refinements analogous to stuttering trace containment. The formalization supports the definition of intuitive specifications of the intended behavior of a program. We present a c...

متن کامل

Type Refinements in an Open World (Extended Abstract)

A refinement is a predicate on the elements of a type that describes their execution behavior. Much work has gone into developing refinements in a closed world, in which the classes of values of a type are fixed statically, as in the case of the natural numbers with zero and succ. Relatively little work has gone into developing refinements in an open world in which new classes may be added dyna...

متن کامل

Type Refinements in an Open World ( Extended

A refinement is a predicate on the elements of a type that describes their execution behavior. Much work has gone into developing refinements in a closed world, in which the classes of values of a type are fixed statically, as in the case of the natural numbers with zero and succ. Relatively little work has gone into developing refinements in an open world in which new classes may be added dyna...

متن کامل

Proving the Correctness of Recursion-Based Automatic Program Transformations

This paper shows how the Improvement Theorem|a semantic condition for the total correctness of program transformation on higher-order functional programs|has practical value in proving the correctness of automatic techniques, including deforestation and supercompilation. This is aided by a novel formulation (and generalisation) of deforestation-like transformations, which also greatly adds to t...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1989